﻿using DimensionsHelper.SourceGeneration.Resources;
using Microsoft.CodeAnalysis;
using System;

namespace DimensionsHelper.SourceGeneration.Enumerator
{
    internal class EnumDiagnostics
    {


        private const string DimensionsHelperCLSourceGenerationName = "DimensionsHelper.CommandLine.SourceGeneration";


        private static DiagnosticDescriptor CreateDescriptor(string id, LocalizableString title, LocalizableString message, string category, DiagnosticSeverity severity, bool isEnabledByDefault = true, LocalizableString description = null)
        {
            return new DiagnosticDescriptor(id, title, message, category, severity, isEnabledByDefault, description);
        }


        private static readonly Type ResourceSource = typeof(Messages);


        public static DiagnosticDescriptor TypeIsNotAnEnumerator { get; } = CreateDescriptor(
            "DHEC1001",
            new LocalizableResourceString(nameof(Messages.TypeIsNotAnEnumeratorTitle), Messages.ResourceManager, ResourceSource),
            new LocalizableResourceString(nameof(Messages.TypeIsNotAnEnumerator), Messages.ResourceManager, ResourceSource),
            DimensionsHelperCLSourceGenerationName,
            DiagnosticSeverity.Warning);


        public static DiagnosticDescriptor TypeIsNotExist { get; } = CreateDescriptor(
            "DHEC1002",
            new LocalizableResourceString(nameof(Messages.TypeIsNotExistTitle), Messages.ResourceManager, ResourceSource),
            new LocalizableResourceString(nameof(Messages.TypeIsNotExist), Messages.ResourceManager, ResourceSource),
            DimensionsHelperCLSourceGenerationName,
            DiagnosticSeverity.Warning);


        public static DiagnosticDescriptor PropertyIsNotExist { get; } = CreateDescriptor(
            "DHEC1003",
            new LocalizableResourceString(nameof(Messages.PropertyIsNotExistTitle), Messages.ResourceManager, ResourceSource),
            new LocalizableResourceString(nameof(Messages.PropertyIsNotExist), Messages.ResourceManager, ResourceSource),
            DimensionsHelperCLSourceGenerationName,
            DiagnosticSeverity.Warning);


        public static DiagnosticDescriptor MemberIsNotProperty { get; } = CreateDescriptor(
            "DHEC1004",
            new LocalizableResourceString(nameof(Messages.MemberIsNotPropertyTitle), Messages.ResourceManager, ResourceSource),
            new LocalizableResourceString(nameof(Messages.MemberIsNotProperty), Messages.ResourceManager, ResourceSource),
            DimensionsHelperCLSourceGenerationName,
            DiagnosticSeverity.Warning);


    }
}
